<?php
/**
 * Created by PhpStorm.
 * User: zd
 * Date: 2018/10/27
 * Time: 16:56
 */

namespace app\api\model;


class MiniAudit extends BaseModel
{
    protected $autoWriteTimestamp = true;
    protected $hidden=['create_time','update_time'];

    /**
     * 创建审核状态
     * @param $data
     * @return $this
     */
    public static function createAudit($data){
        return self::create($data);
    }

    /**
     * 更新审核状态
     * @param $data
     * @param $appid
     * @return $this
     */
    public static function updateAudit($data,$appid){

       $str =  self::where('appid','=',$appid)->update($data);
    }

    /**
     * 更新小程序审核状态
     * @param $id
     * @param $data
     */
    public static function updateAuditById($id,$data){
        $result = self::where('mini_id','=',$id)->update($data);
        return $result;
    }

    /**
     * 用户取消审核时，删除审核信息
     * @param $appid
     * @return int
     */
   public static function deleteAudit($appid){
        return self::where('appid','=',$appid)->delete();
   }


}